-
-
Notifications
You must be signed in to change notification settings - Fork 929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass returnValue to formatter with needlessDisables + invalidScopeDisables #4393
Conversation
output: formatterFunction(stylelintResults), | ||
results: stylelintResults, | ||
results: [], | ||
output: '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initializing these with empty values appears to have been necessary to appease the lint:types
script (tsc
). I'm not familiar with TypeScript, but I imagine there's a way to do this in the @type
comment instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thinks it is fine to initialize with empty fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this problem!
Could you update documentation, please? https://github.com/stylelint/stylelint/blob/master/docs/developer-guide/formatters.md
Okay, docs updated in 2982fa1; preview here. |
|
Fixes #4136. I've shuffled things around in the standalone
prepareReturnValue()
function so that theoutput
is set last and the formatting function gets thereturnValue
object as its second argument, so that needless disables can be accessed like so in a custom formatter:The
returnValue
object includes:errored
flagneedlessDisables
array if configured withreportNeedlessDisables: true
invalidScopeDisables
array if configured withreportInvalidScopeDisables: true
maxWarningsExceeded
object if configured withmaxWarnings